const Router = require('koa-router')
const hanziCharacterRouter = require('./hanziCharacter')
const hanziPinyinRouter = require('./hanziPinyin')
const hanziStructureRouter = require('./hanziStructure')
const hanziStrokeRouter = require('./hanziStroke')
const hanziRadicalRouter = require('./hanziRadical')

// 创建一个父路由，并设置前缀为 /hanzi
const hanziRouter = new Router({ prefix: '/hanzi' })

// 将子路由挂载到父路由下
hanziRouter.use(hanziCharacterRouter.routes(), hanziCharacterRouter.allowedMethods())
hanziRouter.use(hanziPinyinRouter.routes(), hanziPinyinRouter.allowedMethods())
hanziRouter.use(hanziStructureRouter.routes(), hanziStructureRouter.allowedMethods())
hanziRouter.use(hanziStrokeRouter.routes(), hanziStrokeRouter.allowedMethods())
hanziRouter.use(hanziRadicalRouter.routes(), hanziRadicalRouter.allowedMethods())

module.exports = hanziRouter
